package com.dingup.api.enums;

/**
 * Created by wancheng on 2018/7/30.
 */
public enum  DataPermissionEnum {

    ALL(1,"全部"),
    DEPTUP(2,"上级部门及下属部门"),
    DEPTDOWN(3,"所属部门及下属部门"),
    ONESELF(4,"个人");

    public static DataPermissionEnum getEnum(Integer mark){
        DataPermissionEnum en = null;
        for (DataPermissionEnum e: DataPermissionEnum.values()) {
            if(e.getMark().equals(mark)){
                en = e;
                break;
            }
        }
        return en;
    }


    private Integer mark;
    private String description;

    public Integer getMark() {
        return mark;
    }

    public void setMark(Integer mark) {
        this.mark = mark;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    DataPermissionEnum(Integer mark, String description) {
        this.mark = mark;
        this.description = description;
    }
}
